<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<title>导入EXCEL</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
    <link rel="stylesheet" href="/fission/css/iconfont.css">
	<style type="text/css">
		.importExcel_main_contaienr{
			width: 485px;
			margin: 0 auto;
			padding: 32px 32px 32px 0;
			background: #fff;
		}
		.importExcel_title{
			font-size: 17px;
			width: 100%;
			text-align: center;
			margin-top: 2px;
			font-weight: 600;
			line-height: 24px;
			letter-spacing: 1px;
			padding-left: 20px;
		}
		.importExcel_tips{
			background: #f0f8ff;
			border-radius: 2px;
			padding: 8px 17px 7px;
			font-size: 12px;
			color: rgba(0,0,0,.44);
			line-height: 17px;
			margin-top: 8px;
			margin-left: 40px;
		}
		.importExcel_download_contaienr{
			margin-top: 12px;
			font-size: 13px;
			display: flex;
			padding-left: 40px;
		}
		.importExcel_download_contaienr span{
			color: rgba(0,0,0,0.65);
		}
		.importExcel_download_contaienr a{
			color: #1890ff;
		}
		.importExcel_from_contaienr{
			margin-top: 24px;
		}
		.importExcel_button_container{
			display: flex;
			justify-content: flex-end;
			padding-top: 10px;
		}
		.service-card {
		  padding: 0 7px;
		  color: rgba(0,0,0,.65);
		  line-height: 28px;
		  font-size: 13px;
		  display: inline-block;
		  margin: 0 8px 0 5px;
		  -webkit-box-sizing: border-box;
		  box-sizing: border-box;
		  white-space: nowrap;
		  background: #fafafa;
		  border: 1px solid #e9e9e9;
		  border-radius: 4px;
		  position: relative;
		}
		.service-card i {
		  font-size: 14px;
		  display: inline-block;
		  color: #7da3d1;
		  margin-right: 2px;
		}
		.service-card .close {
		  position: absolute;
		  top: -13px;
		  right: -8px;
		  opacity: .6;
		  cursor: pointer;
		}
		.service-card .close:hover {
		  opacity: 1;
		}
	</style>
</head>
<body>
	<form class="layui-form" action="" id="form1">
		<div class="importExcel_main_contaienr">
			 <h2 class="importExcel_title">上传表格</h2>
			 <p class="importExcel_tips">请下载模板后输入手机号上传，可批量复制手机号至模板内，若输入内容有重复手机号或空行将会自动过滤</p>
			 <div class="importExcel_download_contaienr">
			 	<span>点击下载</span>
			 	<a href="download_excel.html">Excel模板</a>
			 </div>
			 <div class="importExcel_from_contaienr">
			 	<div class="layui-form-item">
			 	  <label class="layui-form-label">选择表格</label>
			 	  <div class="layui-input-block">
				    <input type="hidden" name="file_path" id="file_path" value=""/>
					<input type="hidden" name="file_name" id="file_name" value="" />
			 	    <button type="button" class="layui-btn layui-btn-normal" id="test1">
			 	      <i class="layui-icon">&#xe67c;</i>上传表格
			 	    </button>
					<div class="layui-form-mid layui-word-aux" id="file_name_show"></div>
			 	  </div>
			 	</div>
			 	<div class="layui-form-item">
			 	  <label class="layui-form-label">选择员工</label>
			 	  <div class="layui-input-block">
					<span class="layui-btn layui-btn-primary" id="addPeople">+ 选择员工</span>
			 	  </div>
				  <input type="hidden" name="selectedUser" value="" id="selectedUser"/>
				  <div class="" style="margin: 10px 0px 0px 110px;" id="selectedUserCon">
						
				  </div>
			 	</div>
			 	<div class="layui-form-item">
			 	  <label class="layui-form-label">客户标签</label>
			 	  <div class="layui-input-block">
				   <span class="layui-btn layui-btn-primary" id="addLable">+ 选择标签</span>
			 	  </div>
				  <input type="hidden" name="seleckedLable" value="" id="seleckedLable"/>
				  <div class="" style="margin: 10px 0px 0px 110px;" id="selectedLableCon">
						
				  </div>
			 	</div>
			 </div>
			 <div class="layui-form-item importExcel_button_container">
			 	<!--<button type="button" class="layui-btn layui-btn-primary layui-btn-sm">取消</button>-->
			 	<a type="button" class="layui-btn layui-btn-normal layui-btn-sm" onclick="submitForm()">导入</a>
			 </div>
		</div>
		<!-- <div class="check_mian_contaienr">
			<div class="check_main_content">
				<div class="check_mainFirst_content">
					<div class="check_mainFirstSvg_container">
						<svg id="svghide_1" viewBox="0 0 1024 1024" focusable="false" class="" data-icon="caret-down" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"></path></svg>
						<svg id="svgshow_1" viewBox="0 0 1024 1024" focusable="false" class="" data-icon="caret-right" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M715.8 493.5L335 165.1c-14.2-12.2-35-1.2-35 18.5v656.8c0 19.7 20.8 30.7 35 18.5l380.8-328.4c10.9-9.4 10.9-27.6 0-37z"></path></svg>
					</div>
					<input type="checkbox" name="" title="客户类别" lay-skin="primary"> 
				</div>
				<div class="check_mainSecond_content">
					<input type="checkbox" name="" title="教育系统新客户" lay-skin="primary"> 
					<input type="checkbox" name="" title="老客户" lay-skin="primary"> 
					<input type="checkbox" name="" title="小程序新客户" lay-skin="primary"> 
					<input type="checkbox" name="" title="刷脸系统新客户" lay-skin="primary"> 
					<input type="checkbox" name="" title="客户客户客户客户" lay-skin="primary"> 
				</div>
			</div>
			<div class="check_mianButton_contaienr">
				<button type="button" class="layui-btn layui-btn-sm layui-btn-primary">取消</button>
				<button type="button" class="layui-btn layui-btn-sm layui-btn-normal">确定</button>
			</div>
		</div> -->
		
	</form>
	<script src="/layui/layui.js"></script>
	<script src="/js/ajax.js"></script>
	<script>
	function submitForm(){
		var formData = $('#form1').serialize();	
		myAjaxPost(false, true, '', formData, function (resp) {
			if (resp.status == 'success') {
				tusi(resp.msg);
				setTimeout(function(){
					//parent.layer.closeAll('iframe');
					parent.location.href = 'mission_list.html'; 
				},2000);
			}else{
				alert(resp.msg);
				if(resp.data == 1){
					$('#file_path').val('');
					$('#file_name').val('');
					$('#file_name_show').html('');
				}
			}
		});
	}
	//表单
	layui.use('form', function(){
	  var form = layui.form;
	  
	  //监听提交
	  form.on('submit(formDemo)', function(data){
	    layer.msg(JSON.stringify(data.field));
	    return false;
	  });

	});
	// 上传
	layui.use('upload', function(){
	  var upload = layui.upload;
	   
	  //执行实例
	  var uploadInst = upload.render({
		 accept: 'file'
		,field: 'file'
	    ,elem: '#test1' //绑定元素
	    ,url: 'upload_file.html' //上传接口
	    ,done: function(res){
	      //上传完毕回调
		  layer.msg(res.msg);
		  if(res.status == 'success'){
			  $('#file_path').val(res.data.filePath);
		      $('#file_name').val(res.data.fileName);
		      $('#file_name_show').html(res.data.fileName);
		  }
	    }
	    ,error: function(){
	      //请求异常回调
	    }
	  });
	});
	</script>
	<script src="/cdn/jquery.js"></script>
	<script type="text/javascript">
		$('#addPeople').on('click',function(){
			layer.open({
			  type: 2,
			  title: '请选择员工',
			  shadeClose: true,
			  shade: 0.2,
			  area: ['700px', '600px'],
			  content: 'select_user.html'
			}); 
		})
		$('#addLable').on('click',function(){
			layer.open({
			  type: 2,
			  title: '请选择标签',
			  shadeClose: true,
			  shade: 0.2,
			  area: ['700px', '600px'],
			  content: 'select_tag.html'
			}); 
		})
	</script>
</body>
</html>